home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / tests / flts.dia.ref < prev    next >
Text File  |  1999-09-16  |  951b  |  64 lines

  1.  
  2. Leps=1.e-10;
  3.  
  4. //test for flts
  5.  
  6.  a=[1 2 3;
  7.     0 2 4
  8.     0 0 1];
  9.  
  10.  b=[1 0;0 0;0 1];
  11.  
  12.  c=eye(3,3);
  13.  
  14. //
  15.  
  16.  s=syslin('d',a,b,c);
  17.  
  18.  h=ss2tf(s);
  19.  
  20.  u=[1;-1]*(1:10);
  21.  
  22. //
  23.  
  24.  yh=flts(u,h); ys=flts(u,s);
  25.  
  26. if norm(yh-ys)> Leps then bugmes();quit;end
  27.  
  28. //hot restart
  29.  
  30.  [ys1,x]=flts(u(:,1:4),s);ys2=flts(u(:,5:10),s,x);
  31.  
  32.   if norm([ys1 ys2]-ys)>sqrt(%eps) then bugmes();quit;end
  33.  
  34.   yh1=flts(u(:,1:4),h);yh2=flts(u(:,5:10),h,[u(:,2:4); yh(:,2:4)]);
  35.  
  36.   if norm([yh1 yh2]-yh)>sqrt(%eps) then bugmes();quit;end
  37.  
  38. //d<>0
  39.  
  40.  d=[-3 8;4 -0.5;2.2 0.9];
  41.  
  42.  s=syslin('d',a,b,c,d);
  43.  
  44.  h=ss2tf(s);
  45.  
  46.  u=[1;-1]*(1:10);
  47.  
  48. //
  49.  
  50.  rh=flts(u,h); rs=flts(u,s);
  51.  
  52. if norm(rh-rs) > Leps then bugmes();quit;end
  53.  
  54. //hot restart
  55.  
  56.  [ys1,x]=flts(u(:,1:4),s);ys2=flts(u(:,5:10),s,x);
  57.  
  58.   if norm([ys1 ys2]-rs)>sqrt(%eps) then bugmes();quit;end
  59.  
  60.   yh1=flts(u(:,1:4),h);yh2=flts(u(:,5:10),h,[u(:,2:4); yh1(:,2:4)]);
  61.  
  62.   if norm([yh1 yh2]-rh)>sqrt(%eps) then bugmes();quit;end
  63.  
  64.